home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / ICONNECT.CMD < prev    next >
Encoding:
Text File  |  1996-02-12  |  3.0 KB  |  144 lines

  1. # Internet Connection (mankato.mn.us) Login.cmd for Trumpet Winsock
  2. #trace on
  3. #
  4. # set up some strings for dialling up
  5. #
  6. if ![load $number]
  7.   if [query $number "Enter the dial-up phone number"]
  8.     save $number
  9.   end
  10. end
  11. if ![load $username]
  12.   if [username "Enter your username"]
  13.     save $username
  14.   end
  15. end
  16. if ![load $password]
  17.   if [password "Enter your password"]
  18.     save $password
  19.   end
  20. end
  21. if ![load $modemreset]
  22.   if [query $modeminit "Enter your modem reset string"]
  23.     save $modemreset
  24.   end
  25. end
  26. if ![load $modemsetup]
  27.   if [query $modemsetup "Enter your modem setup string"]
  28.     save $modemsetup
  29.   end
  30. end
  31. $prompt = "$"
  32. $userprompt = ":"
  33. $passprompt = "Password:"
  34. $slipcmd = "slip"
  35. $addrtarg = "address="
  36. $pppcmd = "ppp"
  37.  
  38. %attempts = 10
  39. #
  40. #
  41. #----------------------------------------------------------
  42. #
  43. # initialize modem
  44. #
  45. output "at"$modemreset\13
  46. if ! [input 10 OK\n]
  47.   display "Modem is not responding"\n
  48.   abort
  49. end
  50. #
  51. # setup our modem commands
  52. #
  53. output "at"$modemsetup\13
  54. if ! [input 10 OK\n]
  55.   display "Bad modem setup string"\n
  56.   abort
  57. end
  58. #
  59. # send phone number
  60. #
  61. %n = 0
  62. repeat
  63.   if %n = %attempts
  64.     display "Too many dial attempts"\n
  65.     abort
  66.   end
  67.   output "atdt"$number\13
  68.   %ok = [input 60 CONNECT]
  69.   %n = %n + 1
  70. until %ok
  71. input 10 \n
  72. #
  73. #  wait till it's safe to send because some modem's hang up
  74. #  if you transmit during the connection phase
  75. #
  76. wait 30 dcd
  77. #
  78. # now prod the terminal server
  79. #
  80. output \13
  81. #
  82. #  wait for the username prompt
  83. #
  84. input 30 $userprompt
  85. output $username\13
  86. #
  87. # and the password
  88. #
  89. input 30 $passprompt
  90. output $password\13
  91. #
  92. # we are now logged in
  93. #
  94. input 30 $prompt
  95. if %ppp
  96.   #
  97.   # jump into ppp mode
  98.   #
  99.   output $pppcmd\13
  100.   #
  101.   input 30 \n
  102.   #
  103.   display \n
  104.   display *****************************************************************\n
  105.   display * You are connected.\n
  106.   display * Minimize the Trumpet Winsock window to get it out of the way.\n
  107.   display * When you are finished, restore the Trumpet Winsock window,\n
  108.   display * select "Bye" from the "Dialer" menu, then "Exit" from the\n
  109.   display * "File" menu.\n
  110.   display *****************************************************************\n
  111.   display \n
  112.   #
  113. else
  114.   #
  115.   # jump into slip mode
  116.   #
  117.   output $slipcmd\13
  118.   #
  119.   # wait for the address string
  120.   #
  121.   input 30 $addrtarg
  122.   #
  123.   # parse address
  124.   #
  125.   address 30
  126.   input 30 \n
  127.   #
  128.   # we are now connected, logged in and in slip mode.
  129.   #
  130.   display \n
  131.   display *****************************************************************\n
  132.   display * You are connected.  Your IP address is \i.\n
  133.   display * Minimize the Trumpet Winsock window to get it out of the way.\n
  134.   display * When you are finished, restore the Trumpet Winsock window,\n
  135.   display * select "Bye" from the "Dialer" menu, then "Exit" from the\n
  136.   display * "File" menu.\n
  137.   display *****************************************************************\n
  138.   display \n
  139. end
  140. #
  141. # now we are finished.
  142. #
  143.  
  144.